//
// Created by zzh on 2020/12/15.
//

#ifndef FFMPEGOPENCV_JAVACALLBACK_H
#define FFMPEGOPENCV_JAVACALLBACK_H

#include  <jni.h>

class JavaCallback {
public:
    JavaCallback(JavaVM *vm, JNIEnv *env, jobject instance);

    ~JavaCallback();

    void onError(int thread, int errorCode);

    void onPrepare(int thread);

private:
    JavaVM *vm;
    JNIEnv *env;
    jobject instance;
    jmethodID errorMethodID;
    jmethodID prepareMethodID;
};

#endif //FFMPEGOPENCV_JAVACALLBACK_H
